﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using FulcrumApi.entities;

namespace FulcrumApi.helpers
{
    public class FulcrumParser
    {
        protected static T parseJson<T>(Stream input) 
            where T : class
        {
		    return ParseObject.fromXml<T>(input);
        }
	
        public static String readAsString(Stream stream) {
            StreamReader reader = new StreamReader(stream);
            return reader.ReadToEnd();
        }
        
	    public static Projects parse(Stream content) {
		    return parseJson<Projects>(content);
	    }

	    public static Project parseProjet(Stream content) {
		    return parseJson<Project>(content);
	    }
    }
}
